<template>
	<el-dialog 
		title="新增角色" 
		:visible.sync="showAddNew" 
		width="65%" 
		:before-close="handleClose">
		<el-form>
			<table>
				<tr>
					<td>角色名称</td>
					<td>
						<el-input />
					</td>
				</tr>
				<tr>
					<td>角色描述</td>
					<td>
						<el-input />
					</td>
				</tr>
				<tr>
					<td colspan="2" v-for="(item,key) in allRoles" :key="key">{{item.permissions}}</td>
				</tr>
			</table>
		</el-form>
		<span slot="footer" class="dialog-footer">
    <el-button @click="handleClose">取 消</el-button>
    <el-button type="primary" @click="addNewOne">确 定</el-button>
  </span>
	</el-dialog>

</template>
	
<script>
	export default {
		props:['showAddNew',"parentid"],
		computed:{
			allRoles(){
				return this.$store.getters.allRoles
			}
			
		},
		mounted(){
			console.log(this.allRoles);
			this.$store.dispatch('loadAllRole')
		},
		
		methods: {
			handleClose() {
				this.$parent.showAddNew = false;
			},
			addNewOne() {
				
			}
		}
	}
</script>

<style lang="scss" scoped>

</style>